package org.window;

import javafx.event.EventHandler;
import javafx.scene.control.Button;
import javafx.scene.image.Image;
import javafx.scene.input.MouseEvent;
import javafx.scene.layout.*;

/**
 * 枚举
 */
public class PaneAndHBoxFrameAndButtonEnum {
    public static Button button = new Button();
    public static void init(){
        button.setPrefWidth(40);
        button.setPrefHeight(40);
        button.setBackground(new Background(new BackgroundImage(new Image("btn/btn3.png"), BackgroundRepeat.NO_REPEAT ,BackgroundRepeat.NO_REPEAT, BackgroundPosition.CENTER, BackgroundSize.DEFAULT)));
        button.setOnMouseEntered(new EventHandler<MouseEvent>() {
            @Override
            public void handle(MouseEvent event) {
                button.setStyle("-fx-border-radius: 5px;-fx-border-color: #ffffff");
            }
        });
        button.setOnMouseExited(new EventHandler<MouseEvent>() {
            @Override
            public void handle(MouseEvent event) {
                button.setStyle("-fx-border-radius: none");
            }
        });
    }
}
